3.4.41 \(\int \frac {\tan ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx\) [341]

Optimal. Leaf size=344 \[ \frac {2 (a-b) \sqrt {a+b} \cot (c+d x) E\left (\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a b^2 d}+\frac {2 \sqrt {a+b} \cot (c+d x) F\left (\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a b d}+\frac {2 \sqrt {a+b} \cot (c+d x) \Pi \left (\frac {a+b}{a};\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a^2 d}+\frac {2 \tan (c+d x)}{a d \sqrt {a+b \sec (c+d x)}} \]

[Out]

2*(a-b)*cot(d*x+c)*EllipticE((a+b*sec(d*x+c))^(1/2)/(a+b)^(1/2),((a+b)/(a-b))^(1/2))*(a+b)^(1/2)*(b*(1-sec(d*x
+c))/(a+b))^(1/2)*(-b*(1+sec(d*x+c))/(a-b))^(1/2)/a/b^2/d+2*cot(d*x+c)*EllipticF((a+b*sec(d*x+c))^(1/2)/(a+b)^
(1/2),((a+b)/(a-b))^(1/2))*(a+b)^(1/2)*(b*(1-sec(d*x+c))/(a+b))^(1/2)*(-b*(1+sec(d*x+c))/(a-b))^(1/2)/a/b/d+2*
cot(d*x+c)*EllipticPi((a+b*sec(d*x+c))^(1/2)/(a+b)^(1/2),(a+b)/a,((a+b)/(a-b))^(1/2))*(a+b)^(1/2)*(b*(1-sec(d*
x+c))/(a+b))^(1/2)*(-b*(1+sec(d*x+c))/(a-b))^(1/2)/a^2/d+2*tan(d*x+c)/a/d/(a+b*sec(d*x+c))^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.27, antiderivative size = 344, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.304, Rules used = {3979, 4146, 4144, 4006, 3869, 3917, 4089} \begin {gather*} \frac {2 \sqrt {a+b} \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} \Pi \left (\frac {a+b}{a};\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{a^2 d}+\frac {2 (a-b) \sqrt {a+b} \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} E\left (\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{a b^2 d}+\frac {2 \sqrt {a+b} \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} F\left (\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{a b d}+\frac {2 \tan (c+d x)}{a d \sqrt {a+b \sec (c+d x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^2/(a + b*Sec[c + d*x])^(3/2),x]

[Out]

(2*(a - b)*Sqrt[a + b]*Cot[c + d*x]*EllipticE[ArcSin[Sqrt[a + b*Sec[c + d*x]]/Sqrt[a + b]], (a + b)/(a - b)]*S
qrt[(b*(1 - Sec[c + d*x]))/(a + b)]*Sqrt[-((b*(1 + Sec[c + d*x]))/(a - b))])/(a*b^2*d) + (2*Sqrt[a + b]*Cot[c
+ d*x]*EllipticF[ArcSin[Sqrt[a + b*Sec[c + d*x]]/Sqrt[a + b]], (a + b)/(a - b)]*Sqrt[(b*(1 - Sec[c + d*x]))/(a
 + b)]*Sqrt[-((b*(1 + Sec[c + d*x]))/(a - b))])/(a*b*d) + (2*Sqrt[a + b]*Cot[c + d*x]*EllipticPi[(a + b)/a, Ar
cSin[Sqrt[a + b*Sec[c + d*x]]/Sqrt[a + b]], (a + b)/(a - b)]*Sqrt[(b*(1 - Sec[c + d*x]))/(a + b)]*Sqrt[-((b*(1
 + Sec[c + d*x]))/(a - b))])/(a^2*d) + (2*Tan[c + d*x])/(a*d*Sqrt[a + b*Sec[c + d*x]])

Rule 3869

Int[1/Sqrt[csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[2*(Rt[a + b, 2]/(a*d*Cot[c + d*x]))*Sqrt[b
*((1 - Csc[c + d*x])/(a + b))]*Sqrt[(-b)*((1 + Csc[c + d*x])/(a - b))]*EllipticPi[(a + b)/a, ArcSin[Sqrt[a + b
*Csc[c + d*x]]/Rt[a + b, 2]], (a + b)/(a - b)], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0]

Rule 3917

Int[csc[(e_.) + (f_.)*(x_)]/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[-2*(Rt[a + b, 2]/(b*
f*Cot[e + f*x]))*Sqrt[(b*(1 - Csc[e + f*x]))/(a + b)]*Sqrt[(-b)*((1 + Csc[e + f*x])/(a - b))]*EllipticF[ArcSin
[Sqrt[a + b*Csc[e + f*x]]/Rt[a + b, 2]], (a + b)/(a - b)], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rule 3979

Int[cot[(c_.) + (d_.)*(x_)]^2*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Int[(-1 + Csc[c + d*x]
^2)*(a + b*Csc[c + d*x])^n, x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[a^2 - b^2, 0]

Rule 4006

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Dist[c, In
t[1/Sqrt[a + b*Csc[e + f*x]], x], x] + Dist[d, Int[Csc[e + f*x]/Sqrt[a + b*Csc[e + f*x]], x], x] /; FreeQ[{a,
b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0]

Rule 4089

Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)
], x_Symbol] :> Simp[-2*(A*b - a*B)*Rt[a + b*(B/A), 2]*Sqrt[b*((1 - Csc[e + f*x])/(a + b))]*(Sqrt[(-b)*((1 + C
sc[e + f*x])/(a - b))]/(b^2*f*Cot[e + f*x]))*EllipticE[ArcSin[Sqrt[a + b*Csc[e + f*x]]/Rt[a + b*(B/A), 2]], (a
*A + b*B)/(a*A - b*B)], x] /; FreeQ[{a, b, e, f, A, B}, x] && NeQ[a^2 - b^2, 0] && EqQ[A^2 - B^2, 0]

Rule 4144

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Int[(A
- C*Csc[e + f*x])/Sqrt[a + b*Csc[e + f*x]], x] + Dist[C, Int[Csc[e + f*x]*((1 + Csc[e + f*x])/Sqrt[a + b*Csc[e
 + f*x]]), x], x] /; FreeQ[{a, b, e, f, A, C}, x] && NeQ[a^2 - b^2, 0]

Rule 4146

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Simp[(
A*b^2 + a^2*C)*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m + 1)/(a*f*(m + 1)*(a^2 - b^2))), x] + Dist[1/(a*(m + 1)*(
a^2 - b^2)), Int[(a + b*Csc[e + f*x])^(m + 1)*Simp[A*(a^2 - b^2)*(m + 1) - a*b*(A + C)*(m + 1)*Csc[e + f*x] +
(A*b^2 + a^2*C)*(m + 2)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, e, f, A, C}, x] && NeQ[a^2 - b^2, 0] && Int
egerQ[2*m] && LtQ[m, -1]

Rubi steps

\begin {align*} \int \frac {\tan ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx &=\int \frac {-1+\sec ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx\\ &=\frac {2 \tan (c+d x)}{a d \sqrt {a+b \sec (c+d x)}}-\frac {2 \int \frac {\frac {1}{2} \left (a^2-b^2\right )+\frac {1}{2} \left (a^2-b^2\right ) \sec ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx}{a \left (a^2-b^2\right )}\\ &=\frac {2 \tan (c+d x)}{a d \sqrt {a+b \sec (c+d x)}}-\frac {\int \frac {\sec (c+d x) (1+\sec (c+d x))}{\sqrt {a+b \sec (c+d x)}} \, dx}{a}-\frac {2 \int \frac {\frac {1}{2} \left (a^2-b^2\right )-\frac {1}{2} \left (a^2-b^2\right ) \sec (c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx}{a \left (a^2-b^2\right )}\\ &=\frac {2 (a-b) \sqrt {a+b} \cot (c+d x) E\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a b^2 d}+\frac {2 \tan (c+d x)}{a d \sqrt {a+b \sec (c+d x)}}-\frac {\int \frac {1}{\sqrt {a+b \sec (c+d x)}} \, dx}{a}+\frac {\int \frac {\sec (c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx}{a}\\ &=\frac {2 (a-b) \sqrt {a+b} \cot (c+d x) E\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a b^2 d}+\frac {2 \sqrt {a+b} \cot (c+d x) F\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a b d}+\frac {2 \sqrt {a+b} \cot (c+d x) \Pi \left (\frac {a+b}{a};\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a^2 d}+\frac {2 \tan (c+d x)}{a d \sqrt {a+b \sec (c+d x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 23.72, size = 5162, normalized size = 15.01 \begin {gather*} \text {Result too large to show} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[Tan[c + d*x]^2/(a + b*Sec[c + d*x])^(3/2),x]

[Out]

Result too large to show

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(632\) vs. \(2(315)=630\).
time = 0.21, size = 633, normalized size = 1.84

method result size
default \(-\frac {\sqrt {4}\, \left (\cos \left (d x +c \right ) \sqrt {\frac {b +a \cos \left (d x +c \right )}{\left (1+\cos \left (d x +c \right )\right ) \left (a +b \right )}}\, \sin \left (d x +c \right ) \EllipticE \left (\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}, \sqrt {\frac {a -b}{a +b}}\right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, a +\cos \left (d x +c \right ) \sqrt {\frac {b +a \cos \left (d x +c \right )}{\left (1+\cos \left (d x +c \right )\right ) \left (a +b \right )}}\, \sin \left (d x +c \right ) \EllipticE \left (\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}, \sqrt {\frac {a -b}{a +b}}\right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, b -2 \cos \left (d x +c \right ) \sqrt {\frac {b +a \cos \left (d x +c \right )}{\left (1+\cos \left (d x +c \right )\right ) \left (a +b \right )}}\, \sin \left (d x +c \right ) \EllipticPi \left (\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}, -1, \sqrt {\frac {a -b}{a +b}}\right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, b +\sqrt {\frac {b +a \cos \left (d x +c \right )}{\left (1+\cos \left (d x +c \right )\right ) \left (a +b \right )}}\, \sin \left (d x +c \right ) \EllipticE \left (\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}, \sqrt {\frac {a -b}{a +b}}\right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, a +\sqrt {\frac {b +a \cos \left (d x +c \right )}{\left (1+\cos \left (d x +c \right )\right ) \left (a +b \right )}}\, \sin \left (d x +c \right ) \EllipticE \left (\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}, \sqrt {\frac {a -b}{a +b}}\right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, b -2 \sqrt {\frac {b +a \cos \left (d x +c \right )}{\left (1+\cos \left (d x +c \right )\right ) \left (a +b \right )}}\, \sin \left (d x +c \right ) \EllipticPi \left (\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}, -1, \sqrt {\frac {a -b}{a +b}}\right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, b -\left (\cos ^{2}\left (d x +c \right )\right ) a +\left (\cos ^{2}\left (d x +c \right )\right ) b +a \cos \left (d x +c \right )-b \cos \left (d x +c \right )\right ) \sqrt {\frac {b +a \cos \left (d x +c \right )}{\cos \left (d x +c \right )}}}{d \left (b +a \cos \left (d x +c \right )\right ) \sin \left (d x +c \right ) b a}\) \(633\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^2/(a+b*sec(d*x+c))^(3/2),x,method=_RETURNVERBOSE)

[Out]

-1/d*4^(1/2)*(cos(d*x+c)*((b+a*cos(d*x+c))/(1+cos(d*x+c))/(a+b))^(1/2)*sin(d*x+c)*EllipticE((-1+cos(d*x+c))/si
n(d*x+c),((a-b)/(a+b))^(1/2))*(cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*a+cos(d*x+c)*((b+a*cos(d*x+c))/(1+cos(d*x+c))/
(a+b))^(1/2)*sin(d*x+c)*EllipticE((-1+cos(d*x+c))/sin(d*x+c),((a-b)/(a+b))^(1/2))*(cos(d*x+c)/(1+cos(d*x+c)))^
(1/2)*b-2*cos(d*x+c)*((b+a*cos(d*x+c))/(1+cos(d*x+c))/(a+b))^(1/2)*sin(d*x+c)*EllipticPi((-1+cos(d*x+c))/sin(d
*x+c),-1,((a-b)/(a+b))^(1/2))*(cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*b+((b+a*cos(d*x+c))/(1+cos(d*x+c))/(a+b))^(1/2
)*sin(d*x+c)*EllipticE((-1+cos(d*x+c))/sin(d*x+c),((a-b)/(a+b))^(1/2))*(cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*a+((b
+a*cos(d*x+c))/(1+cos(d*x+c))/(a+b))^(1/2)*sin(d*x+c)*EllipticE((-1+cos(d*x+c))/sin(d*x+c),((a-b)/(a+b))^(1/2)
)*(cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*b-2*((b+a*cos(d*x+c))/(1+cos(d*x+c))/(a+b))^(1/2)*sin(d*x+c)*EllipticPi((-
1+cos(d*x+c))/sin(d*x+c),-1,((a-b)/(a+b))^(1/2))*(cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*b-cos(d*x+c)^2*a+cos(d*x+c)
^2*b+a*cos(d*x+c)-b*cos(d*x+c))*((b+a*cos(d*x+c))/cos(d*x+c))^(1/2)/(b+a*cos(d*x+c))/sin(d*x+c)/b/a

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+b*sec(d*x+c))^(3/2),x, algorithm="maxima")

[Out]

integrate(tan(d*x + c)^2/(b*sec(d*x + c) + a)^(3/2), x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+b*sec(d*x+c))^(3/2),x, algorithm="fricas")

[Out]

integral(sqrt(b*sec(d*x + c) + a)*tan(d*x + c)^2/(b^2*sec(d*x + c)^2 + 2*a*b*sec(d*x + c) + a^2), x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan ^{2}{\left (c + d x \right )}}{\left (a + b \sec {\left (c + d x \right )}\right )^{\frac {3}{2}}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**2/(a+b*sec(d*x+c))**(3/2),x)

[Out]

Integral(tan(c + d*x)**2/(a + b*sec(c + d*x))**(3/2), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+b*sec(d*x+c))^(3/2),x, algorithm="giac")

[Out]

integrate(tan(d*x + c)^2/(b*sec(d*x + c) + a)^(3/2), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\mathrm {tan}\left (c+d\,x\right )}^2}{{\left (a+\frac {b}{\cos \left (c+d\,x\right )}\right )}^{3/2}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^2/(a + b/cos(c + d*x))^(3/2),x)

[Out]

int(tan(c + d*x)^2/(a + b/cos(c + d*x))^(3/2), x)

________________________________________________________________________________________